package com.bw.mvi.http

import okhttp3.OkHttpClient
import okhttp3.logging.HttpLoggingInterceptor
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import java.util.concurrent.TimeUnit

class  RetrofitManager {

    companion object{
        fun getRetrofit():Retrofit{
            val client = OkHttpClient.Builder()
                .addInterceptor(HttpLoggingInterceptor().setLevel(HttpLoggingInterceptor.Level.BODY))
                .readTimeout(60,TimeUnit.SECONDS)
                .writeTimeout(50,TimeUnit.SECONDS)
                .build()
            return Retrofit.Builder()
                .baseUrl("http://10.161.9.80:8886/")
                .client(client)
                .addConverterFactory(GsonConverterFactory.create())
//                .addCallAdapterFactory()
                .build()
        }
    }


}